package com.itheima.controller;

import com.itheima.common.CommonResult;
import com.itheima.pojo.ShoppingCard;
import com.itheima.service.ShoppingCartService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/shoppingCart")
public class ShoppingCartController {

    @Autowired
    private ShoppingCartService shoppingCartService;

    @GetMapping("/list")
    public CommonResult list(){
        List<ShoppingCard> list = shoppingCartService.getList();
        return CommonResult.success(list);
    }

}
